<?php

/**
 * Created by PhpStorm
 * User: 林振宇
 * Date: 2020/8/19
 * Time: 15:40
 */

namespace app\common\controller;

class Messages
{

    //进场开始计时订阅消息
    public function admission($res)
    {
        $product_snapshot = json_decode($res['product_snapshot'], true);
        return [
            'thing4' => [
                'value' => '湖边设有景观灯饰，游玩时船须至少离岸一米',
            ],
            'character_string3' => [
                'value' => $res['order_number'],
            ],
            'time2' => [
                'value' => date('Y-m-d H:i:s', $res['admission_time']),
            ],
            'thing1' => [
                'value' => $product_snapshot['name'],
            ]
        ];

    }


    //出场订阅消息
    public function appearance($res)
    {
        return [
            'character_string1' => [
                'value' => $res['order_number'],
            ],
            'time2' => [
                'value' => date('Y-m-d H:i:s', $res['appearance_time']),
            ],
            'thing3' => [
                'value' => '点击进入查看',
            ]
        ];

    }


    //待核销退款 订阅消息
    public function refund($res)
    {
        return [
            'character_string1' => [
                'value' => $res['order_number'],
            ],
            'amount2' => [
                'value' => $res['order_price'],
            ],
            'time3' => [
                'value' => date('Y-m-d H:i:s', time()),
            ]
        ];

    }

    //出场退款 订阅消息
    public function refund2($res)
    {
        return [
            'character_string1' => [
                'value' => $res['order_number'],
            ],
            'amount2' => [
                'value' => $res['tk_price'],
            ],
            'time3' => [
                'value' => date('Y-m-d H:i:s', time()),
            ]
        ];

    }


}
